<?php

class news_model extends my_model{
	function __construct(){
		parent::__construct();
		$this->_prefix = "pos";
		$this->_column = array(
								'id'			=>$this->_prefix."_id",
								'title'			=>$this->_prefix."_title",
								'content'		=>$this->_prefix."_content",
								'usr_ip'		=>$this->_prefix."_usr_ip",
								'status'		=>$this->_prefix."_status",
								'comment_status'=>$this->_prefix."_comment_status",
								'usr_id'		=>$this->_prefix."_usr_id",
								'cat_id'		=>$this->_prefix."_cat_id",
								'typ_id'		=>$this->_prefix."_typ_id",
								'cr_date'		=>$this->_prefix."_cr_date",
								'lu_date'		=>$this->_prefix."_lu_date",
								'lu_uid'		=>$this->_prefix."_lu_uid",
								'url'				=>$this->_prefix."_url",
								'type'			=>$this->_prefix."_type"
			);
		$this->_join_column = array(
								'firstname' => "usr_firstname",
								'lastname' => "usr_lastname",
								'mobile' => "usr_mobile",
								'phone' => "usr_phone",
								'email' => "usr_email",
								'address' => "usr_address",
								'district' => "usr_district",
								'province' => "usr_province",
								'zipcode' => "usr_zipcode"
		);
		$this->_table = "ci_post";
	}

	function get($options = NULL){
		$this->db->where("pos_type","news");
		$this->db->join("ci_user","ci_user.usr_id = ci_post.pos_usr_id");
		$mainTable = parent::get($options);
		return $mainTable;
	}

	function add($options = NULL){
		$this->db->set("pos_type","news");
		return parent::add($options);
	}
}



?>